<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<fmt:setBundle basename="baiwa.rta.language.room.room_label" />

<script type="text/javascript" src="../js/controller/room/RM001A.js" ></script>

<div id="container">
	<div id="content">
		<div class="warpper">
		<form action="RM001Aadd" method="post">
			
			<!-- ---------- Require Hidden Field ---------------------- -->
			
			<script type="text/javascript">
				$(document).ready(function() {
					var tower = "${model.tower.tower}";
					var floor = "${model.tower.floor}";
					var unit = "${model.tower.unitNo}";
					var addr = "${model.tower.address}";
					var obj = {
						'tower' : tower,
						'floor': floor,
						'unitNo' : unit,
						'address' : addr
					}
					if(tower!=''){
						_COMBOBOX.TowerFloorUnitAddrCombo('tower', 'floor' , 'unit' , 'address' , 'roomId', obj); // Load Tower Criteria Combobox
	
					}else{
						_COMBOBOX.TowerFloorUnitAddrCombo('tower', 'floor' , 'unit' , 'address' , 'roomId',null); // Load Tower Criteria Combobox
					}
				});
			</script>
			
			<input type="hidden" name="model.accrid" value="${model.accrid}" />
			<input type="hidden" name="mode" value="${mode}" />
			<input id="roomId" name="model.rlrmid" value="${model.rlrmid}" type="hidden"> <!--  Room ID For Save & Edit -->
			<s:set var="editable">${empty model.accrid? '':'input-readOnly'}</s:set>
			
			<!-- ---------- Require Hidden Field ----------------------	 -->
		
			<table class="from" cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
				<tr>
					<td colspan="9" class="header2" style="border-bottom: 1px #bbb solid;">Criteria</td>
				</tr>
			</table>
			<table class="from" cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
				
				<tr>
					<td class="header">Tower </td>
					<td><select id="tower"  class="required ${editable}">
					</select><span class="required"></span></td>
				
					<td class="header">Floor </td>
					<td><select id="floor" class="required ${editable}"></select><span class="required"></span></td>
				
					<td class="header">Unit </td>
					<td><select id="unit"  class="required ${editable}"></select><span class="required"></span></td>
				
					<td class="header">Address </td>
					<td><select id="address" class="required ${editable}"></select><span class="required"></span></td>
				
				</tr>
				
			</table>
			
			<br>
			<table class="from" cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
				<tr>
					<td colspan="9" class="header2" >Detail</td>
				</tr> 
				
			</table>
		
		<div class="panel panel-default"><div class="panel-body">	
<!-- 			Panel -->
		<table border="0">
				<tr>
					<td  class="header">User No. </td>
					<td><input class="required ${editable}" id="userNo" placeholder="User No." name="model.accridusrno" type="text" style="width: 300px;"  
						value="${model.accridusrno}"><span class="required"></span></td>
					<td align="right"><label>Status</label></td>
							<td>
									<label class="radio-inline"> <input type="radio" 
										name="model.accrstat" checked
										 ${model.accrstat == 'Y' ? 'checked=""' : ''} class="ng-pristine ng-valid" value="Y">
										Active
									</label> <label class="radio-inline"> <input type="radio"
										name="model.accrstat" ${model.accrstat == 'N' ? 'checked=""' : ''}
										class="ng-pristine ng-valid"  value="N">
										Inactive
									</label>
							</td>
				</tr>
				<tr>
					<td  class="header">Card No. </td>
					<td><input class="" id="cardNo" name="model.accrcrdid" type="text" style="width: 300px;" 
						value="${model.accrcrdid}" placeholder="Card No."></td>
					<td class="header">Long Range No. </td>
					<td><input class=" " id="longRange"  placeholder="Long Rang No." name="model.accrlrno" type="text" style="width: 300px;"  
						value="${model.accrlrno}"></td>
				</tr>
				<tr>
					<td class="header">Start Date </td>
					<td><input class=" "  placeholder="Start Date" id="createDate" name="model.accrstatdat" type="text" style="width: 300px;"  
						value="${accrstatdat}" readonly="true"></td>
					<td class="header">Active Date</td>
					<td><input class=" " placeholder="Active Date" id="lastDate" name="model.accratvdat" type="text" style="width: 300px;"  
						value="${accratvdat}" ></td>
				
				</tr>
			</table>	
<!-- 			Button -->
			</div></div>
			
			<table>
				<tr>
<!-- 					<td style="text-align: center;"> -->
<%-- 						<button type="button"  class="btn btn-default btn-primary" onclick="window.location='RM001'"><fmt:message key="button.back" /> </button>&nbsp; --%>
<%-- 						<button type="submit"  class="btn btn-default btn-primary"><fmt:message key="button.save" /> </button>&nbsp; --%>
<!-- 						<button type="button"  class="btn btn-default btn-primary">  Delete </button> -->
<!-- 					</td> -->
					<td align="left">
						<button type="button" class="btn btn-default btn-primary" onclick="location = 'RM001'"><i class="fa fa-hand-o-left"></i> Back</button>
					</td>
					<td align="right">
						<button id="btnSubmit" type="button" class="btn btn-default btn-primary"><i class="fa fa-save"></i> Save</button>
					</td>
				</tr>	
			</table>
			
	</form>		
		</div>
	</div>
</div>
